// 字面量 类型
const str: 'hello' = 'hello';

function changeDirection(direction: 'up' | 'down' | 'left' | 'right') { }
changeDirection('down')


// 枚举 类型 (字符串枚举)
enum Direction {
    Up = 'up',
    Down = 'down',
    Left = 'left',
    Right = 'right'
}
// 枚举成员 默认有值，默认从0 开始 (数字枚举)
enum Direction2 { Up, Down, Left, Right }

function changeDirection2(direction: Direction) { }

changeDirection2(Direction.Down)


// any 类型
let aaa: any = 123;
aaa.name = 'aaa';
aaa()


// typeof 类型
let p = { x: 1, y: 2 }
function formatPoint(point: { x: number, y: number }) {}

function formatPoint2(point: typeof p) {} 






